// header file for all global functions
#ifndef __TOOLBOX__
#define __TOOLBOX__

class Players; // somewhere over the rainbow there is a class
class Sports; // class sports exists
class Division; // class division exists
struct Table;
extern Sports sports; // sports object exists

void printMenu(MenuLevels menulvl); // print menu for given menulevel

void writeToFile(Players* pplayers); // write current players to file
void writeToFile(Sports* psports); // write current sports to file
void writeToFile(Division* pdivision); // write current divisions to file

char* Itoa(int value, char* str, int radix); // not our work,
                             // copied from the public domain
void displaytp();
void readFromFile();
void changepl();
void printWriteTable();

void selectionSortTable(Table* tables); // sorts tables descending
void selectionSortAsc(int* const sortarr, const int arrlength); // selection sort ascending, smallest on top
void selectionSortDesc(int* const sortarr, const int arrlength); // selection sort descending, biggest on top
void swap(int* const swapvar1, int* const swapvar2); // used in the sorting functions

void printWriteMatchResults();
void readResults(ifstream* in);

#endif
